package com.lq.tech.service.index;

import com.lq.tech.infra.PageCommonVO;
import com.lq.tech.infra.SearchCommonVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lq.tech.dao.entity.index.IndexFloorConfDO;
import com.lq.tech.dao.mapper.index.IndexFloorConfMapper;
import com.lq.tech.service.vo.index.IndexFloorConfVO;
import com.lq.tech.infra.ErrorCode;
import com.lq.tech.service.BaseService;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
public class IndexFloorConfService extends BaseService<IndexFloorConfVO, IndexFloorConfDO>
{
    @Autowired
    private IndexFloorConfMapper indexFloorConfMapper;

    public IndexFloorConfService()
    {
        super(IndexFloorConfVO.class, IndexFloorConfDO.class);
    }

    @PostConstruct
    public void init()
    {
        super.addMapper(indexFloorConfMapper);
    }

    @Override
    public IndexFloorConfVO item(String id)
    {
        return super.item(id);
    }

    @Override
    public PageCommonVO list(SearchCommonVO<IndexFloorConfVO> condition)
    {
        return super.list(condition);
    }

    @Override
    public ErrorCode insert(IndexFloorConfVO indexFloorConf)
    {
        return super.insert(indexFloorConf);
    }

    @Override
    public ErrorCode update(IndexFloorConfVO indexFloorConf)
    {
        return super.update(indexFloorConf);
    }

    /**
     * 查询楼层配置信息
     *
     * @return List<IndexFloorConfVO>
     */
    public List<IndexFloorConfVO> listFloor()
    {
        List<IndexFloorConfDO> floorConfDOList = indexFloorConfMapper.listFloor();
        return getVOList(floorConfDOList);
    }
}
